import React from 'react';
import { Carousel } from 'antd-mobile';
import { NavLink } from 'react-router-dom';
import './index.css'
import BaseURL from './../config/config.js'
import indexUser from './../ApiTypes/ApiTypes.js'
import MessageAuto from './MessageAuto.jsx'
import Upvote from './Upvote.jsx'
import Navigation from './Navigation.jsx'
import axios from 'axios';
import $ from 'jquery';
import IndexStore from '../../store/IndexStore.js';
import "babel-polyfill";
import { observer } from 'mobx-react';
import { observable, computed, action } from 'mobx';
const PlaceHolder = ({ className = '' }) => (
    <div className={`${className} placeholder`}>Block</div>
);  
class index extends React.Component {    
    constructor(props) {
        super(props);            

        this.state = {      
            banner: null
        };   
    }   
    async componentDidMount() {
        const bannerArray = await IndexStore.getBanner();     
        var bannerArr = eval ("(" + bannerArray + ")");   
        console.log(bannerArr);
        this.setState({
            banner: bannerArray.data
        })        
    }
    render() {          
        return (
            <div className="jinpu-hospital-index">
                <div className="banner-wrap">
                    <Carousel>
                        <div className="banner-wrap-banner"><img src=""/></div>             
                        <div className="banner-wrap-banner"><img src=""/></div>               
                    </Carousel>
                </div>
                <div className="message-auto-play-wrap">
                    <img className="message-auto-play-image" src={require('./../images/message.png')}/>    
                    <div className="message-auto-play-messge">
                        <MessageAuto />        
                    </div>        
                    <div style={{ clear: "both" }}></div>
                </div>
                <NavLink exact to="/healthlist" activeClassName="navigation-active"> 
                    <div className="health-news">
                        <img className="health-news-img" src={require('./../images/biaotilantishi1.png')} /> 
                        <span className="health-news-title">健康咨询</span>   
                        <div className="health-news-more">更多<img className="health-news-more-img" src={require('./../images/jiantou.png')} /></div>
                        <div style={{ clear: "both" }}></div>
                    </div>
                </NavLink>
                <div className="health-article">
                    <img className="health-article-img" />
                    <div className="health-article-title">舒经络，补气血</div>
                    <Upvote />                    
                </div>
                <div className="health-article">
                    <img className="health-article-img" />
                    <div className="health-article-title">舒经络，补气血，冬天喝它正当时</div>
                    <Upvote />                      
                </div>
                <NavLink exact to="/doctorlist" activeClassName="navigation-active"> 
                    <div className="doctor-news">
                        <img className="doctor-img" src={require('./../images/biaotilantishi2.png')} /> 
                        <span className="doctor-title">金浦名医</span>   
                        <div className="doctor-more">更多<img className="doctor-more-img" src={require('./../images/jiantou.png')} /></div>
                        <div style={{ clear: "both" }}></div>
                    </div>
                </NavLink>
                <div className="famous-health-article">                    
                    <img className="famous-health-article-img" />     
                    <div className="famous-health-doctor-text">
                        <div className="famous-health-doctor" >迈克张<span>主治医师</span></div>
                        <div className="famous-health-doctor-major">儿科 慢性病 中医妇科</div>   
                    </div>
                </div>
                <div className="famous-health-article">                    
                    <img className="famous-health-article-img" />     
                    <div className="famous-health-doctor-text">
                        <div className="famous-health-doctor" >迈克张<span>主治医师</span></div>
                        <div className="famous-health-doctor-major">儿科 慢性病 中医妇科</div>   
                    </div>
                </div>
                <div className="navigation-index-wrap">
                    <Navigation />
                </div>
            </div>
        )
    }
}
//导出组件
export default index;
